﻿namespace System.Data.Entity.Extensions.UnitOfWork
{
    /// <summary>
    /// 
    /// </summary>
    public interface IUnitOfWork : IDisposable
    {
        #region Commit

        /// <summary>
        /// 
        /// </summary>
        event AccessEventHandler CanCommit;

        /// <summary>
        /// 
        /// </summary>
        event CommitEventHandler Committing;

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        int Commit();

        /// <summary>
        /// 
        /// </summary>
        event CommitEventHandler CommittingFailed;

        /// <summary>
        /// 
        /// </summary>
        event CommitEventHandler Committed;

        #endregion
    }
}
